<template>
	<div id="userinfo"><el-button @click="logout">退出登录</el-button></div>
</template>

<script>
export default {
	methods: {
		logout() {
			this.$confirm('确定退出登录?', '提示', {
				confirmButtonText: '确定',
				cancelButtonText: '取消',
				type: 'warning'
			})
				.then(() => {
					this.$store.commit('remove_admin');
					this.$router.push('/login');
				})
				.catch(() => {});
		}
	}
};
</script>

<style lang="scss">
	#userinfo{
		display: flex;
		justify-content: center;
		align-items: center;
		height: 300px;
	}
</style>
